package routers

import (
	"github.com/gin-gonic/gin"
	"mini-app/internal/app/web/middleware"
)

func Default(router *gin.Engine) {
	router.Use(middleware.RecoveryMiddleware())

	// 健康检查
	router.GET("/health", func(c *gin.Context) {
		c.JSON(200, "ok")
	})
	// 万象小程序发起的健康检查
	router.GET("/health-status", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"status": "UP",
		})
	})
	// 后端
	{
		admin := router.Group("admin")
		adminGroup(admin)
	}
	// 前端
	{
		web := router.Group("web")
		webGroup(web)
	}
	// 广告
	{
		advertisement := router.Group("advertisement")
		advertisementGroup(advertisement)
	}
}
